The present invention relates to a method for loading a program, and more particularly to a method for generating an absolute address program from a relative address program and loading the absolute address program into memory. In addition, the present invention relates to a computer software product, such as a computer-readable medium, that contains the above-mentioned method for loading a program.
Two types of program object codes are absolute address codes and relative address codes. Absolute address codes are instructions that use absolute addresses when referring to data in memory or designating branch destinations. Programs that CPU's can execute directly are programs written using absolute addresses.
Relative address codes are instructions that designate memory addresses or branch destinations by using relative addresses such as symbolic addresses. Since CPU's cannot execute a program which is written using relative addresses, a relative address program is converted into an absolute address program through a loader prior to execution by the CPU. Unlike the absolute address programs, it is possible to specify storage locations for relative address programs when they are loaded into memory. Relative address format programs are currently used in many computers because it is possible to freely select storage locations in memory for the relative address format programs.
A relative address format program file includes a program proper and relocation information. Relocation information is information that is referred to by the loader when converting a relative address format program into an absolute address format program. This is outlined in Chapter 5, Loader, particularly in Sub-chapter 5.1.5, Relocating Loader, pp. 170-174 of System Program I by John J. Donovan, 1976, published by Nippon Computer Kyokai. The most common of the program file formats is COFF (Common Object File Format), a detailed description of which, is given in Chapter 4, File Formats a. Out (4), pp. 1-2 of AT&T UNIX SYSTEM V Programmers Reference Manual, 1990.